<template>
	<view class="app">
		<uni-card :title="list.title" extra="">
			<text class="uni-body">
				<view class="title1">
					佣金：{{list.yongjin}}&nbsp;元
				</view>
				<br />
				<view class="title1">
					支付方式：{{list.qudao}}
				</view>
				<br />
				<view class="title1">
					发布笔数：{{list.geshu}}
				</view>
				<br />
				<view class="title1">
					剩余笔数：
				</view>
				<br />
				<view class="title1">
					完成笔数：
				</view>
				<br />
				<view class="title1">
					支付通道：
				</view>
				<br />
				<cover-image :src="'http://127.0.0.1:8089/intool/' + list.images"></cover-image>
			</text>
		</uni-card>

		<view>
			<uni-card v-for="item in list.wordList" :title="'提交人:' + item.name" :extra="'审核状态:' + item.status"
				@click="goSh(item)">
				<text class="uni-body">提交时间:{{item.dateTime}}</text>
			</uni-card>
			<!-- <uni-card title="任务名称" extra="佣金">
					<text class="uni-body">支付方式，时间，剩余笔数</text>
				</uni-card>
				<uni-card title="任务名称" extra="佣金">
					<text class="uni-body">支付方式，时间，剩余笔数</text>
				</uni-card> -->
		</view>
	</view>
</template>

<script>
	import {
		baseDefaultUrl
	} from '../../config/config'
	export default {
		data() {
			return {
				list: '',
				tableList: []
			}
		},
		onShow() {
			uni.request({
				url: baseDefaultUrl + "/inter/t-work/get_workg?id=" + this.$route.query.id,
				method: 'GET',
				header: {
					"Authorization": uni.getStorageSync('token')
				},
				success: (res) => {
					if (res.data.code != 0) {
						this.list = res.data.data
						console.log(this.list)
						this.list.username = this.list.username.slice(0, 3) + '****' + this.list.username
							.slice(-4)
					} else {
						uni.showToast({
							title: res.data.message,
							icon: 'error'
						});
					}
				}
			})
			this.getList(1)
		},
		methods: {
			getList(statusw) {
				uni.request({
					url: baseDefaultUrl + "/inter/t-work/list_work",
					method: 'GET',
					data: {
						"username": uni.getStorageSync("phone"),
						"status": statusw
					},
					header: {
						"Authorization": uni.getStorageSync('token')
					},
					success: (res) => {
						if (res.data.code != 0) {
							this.tableList = res.data.data
						} else {
							alert(res.data.message)
						}
					}
				})
			},
			tijiao() {
				uni.request({
					url: baseDefaultUrl + "/inter/t-work/q_work",
					method: 'GET',
					data: {
						"username": uni.getStorageSync('phone'),
						"workId": this.list.id
					},
					header: {
						"Authorization": uni.getStorageSync('token')
					},
					success: (res) => {
						if (res.data.code != 0) {
							uni.navigateBack({
								delta: 1,
								success: function() {
									setTimeout(function() {
										uni.showToast({
											title: "领取成功",
											icon: 'success',
											duration: 2000
										});
									}, 500);
								}
							});
						} else {
							uni.showToast({
								title: res.data.message,
								icon: 'error'
							});
						}
					}
				})
			},
			goSh(params) {
				uni.navigateTo({
					url: '/pages/shenhe/shenhe?img=' + params.zhengming + '&name=' + params.username + '&id=' +
						params.id + '&zhuangt=' + params.status
				})
			},
		}
	}
</script>

<style scoped>
	/deep/ .uni-card .uni-card__header .uni-card__header-content .uni-card__header-content-title {
		font-size: 40rpx;
		font-weight: bolder;
		line-height: 60rpx;
	}

	.title1 {
		font-size: 30rpx;
		font-weight: bolder;
		color: black;
	}

	.tijiao {
		padding: 30rpx;
	}
</style>